package com.zhao.abstractFactory.factory.impl;

import com.zhao.abstractFactory.factory.AnimalFactory;
import com.zhao.abstractFactory.pojo.Animal;
import com.zhao.abstractFactory.pojo.impl.Cat;
import com.zhao.abstractFactory.pojo.impl.Dog;

public class LandAnimal extends AnimalFactory {
    @Override
    public Animal createAnimal(String name) {
        if (name.equalsIgnoreCase("cat")) {
            return new Cat();
        } else if (name.equalsIgnoreCase("dog")) {
            return new Dog();
        }
        return null;
    }
}
